package com.bdqn.service.impl;

import ch.qos.logback.core.util.StringUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bdqn.mapper.UserMapper;
import com.bdqn.pojo.User;
import com.bdqn.service.UserService;
import org.springframework.stereotype.Service;

/**
 * @author LILIBO
 * @description 针对表【sys_role】的数据库操作Service实现
 * @createDate 2024-09-07 10:46:48
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    /**
     * 用户登录
     *
     * @param usrName
     * @param usrPassword
     * @return
     */
    @Override
    public User login(String usrName, String usrPassword) {
        if (StringUtil.isNullOrEmpty(usrName) || StringUtil.isNullOrEmpty(usrPassword)) {
            return null;
        }
        QueryWrapper<User> qw = new QueryWrapper<>();
        qw.eq("usr_name", usrName);
        qw.eq("usr_password", usrPassword);
        return baseMapper.selectOne(qw);
    }

}




